/*
 * DownloadManager.java
 *
 * Created on March 23, 2008, 11:19 AM
 */

package seeqpod;

import javax.swing.ImageIcon;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author  Rahul Behera
 */
public class DownloadManager extends javax.swing.JFrame implements Runnable {
    
    /** Creates new form DownloadManager */
    public DownloadManager() {
        initComponents();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        ScrollPane = new javax.swing.JScrollPane();
        DownloadTable = new javax.swing.JTable();
        PauseButton = new javax.swing.JButton();
        ResumeButton = new javax.swing.JButton();
        CancelButton = new javax.swing.JButton();
        ClearButton = new javax.swing.JButton();
        ClearAllButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("shmolderin seeqpod - download manager");
        setIconImage(new ImageIcon(getClass().getResource("/seeqpod/images/seeqpodlogo.png")).getImage());
        setLocationByPlatform(true);

        ScrollPane.setAutoscrolls(true);

        DownloadTable.setFont(new java.awt.Font("Cambria", 0, 11));
        DownloadTable.setForeground(new java.awt.Color(40, 111, 176));
        DownloadTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null}
            },
            new String [] {
                "File Name", "Size", "Progress", "Status", "URL"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Integer.class, java.lang.Object.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        DownloadTable.setFillsViewportHeight(true);
        DownloadTable.setGridColor(new java.awt.Color(255, 255, 255));
        DownloadTable.setName("Download Manager"); // NOI18N
        ScrollPane.setViewportView(DownloadTable);

        PauseButton.setText("Pause");

        ResumeButton.setText("Resume");
        ResumeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ResumeButtonActionPerformed(evt);
            }
        });

        CancelButton.setText("Cancel");

        ClearButton.setText("Clear");

        ClearAllButton.setText("Clear All");

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(ScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE)
                    .add(layout.createSequentialGroup()
                        .add(PauseButton)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(ResumeButton)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(CancelButton)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(ClearButton)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(ClearAllButton)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .add(ScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.CENTER)
                    .add(PauseButton)
                    .add(ResumeButton)
                    .add(CancelButton)
                    .add(ClearButton)
                    .add(ClearAllButton))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void ResumeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ResumeButtonActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_ResumeButtonActionPerformed
    

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                try{
                    UIManager.setLookAndFeel(
                    UIManager.getSystemLookAndFeelClassName());
                } 
                catch (Exception e) {
               // handle exception
                }
                new DownloadManager().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton CancelButton;
    private javax.swing.JButton ClearAllButton;
    private javax.swing.JButton ClearButton;
    private javax.swing.JTable DownloadTable;
    private javax.swing.JButton PauseButton;
    private javax.swing.JButton ResumeButton;
    private javax.swing.JScrollPane ScrollPane;
    // End of variables declaration//GEN-END:variables

    public void run() {
        
    }
    
}
